package com.example.administrator.exkotlin.broadcast

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.widget.Toast

class MyTestReceiver : BroadcastReceiver() {
    companion object {
        const val MY_BROACAST_TEST_01="com.lp.exkotlin.testBroacast01"
    }
    override fun onReceive(context: Context, intent: Intent) {
     when(intent.action){
         MY_BROACAST_TEST_01->{
             val longExtra = intent.getLongExtra("test01",0L)
             Toast.makeText(context, "收到自定义广播01$longExtra", Toast.LENGTH_SHORT).show()
         }
     }
    }
}
